package com.springcloud.xxkfz.controller;

import com.springcloud.xxkfz.service.OrderService;
import com.springcloud.xxkfz.vo.AccountVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderController {

	@Autowired
	private OrderService orderService;


	/**
	 * 调用account服务获取列表数据
	 *
	 * @return
	 */
	@GetMapping("/list")
	public List<AccountVO> getAccountList() {
		return orderService.getAccountList();
	}

	/**
	 * 调用account服务获取数据
	 *
	 * @param id
	 * @return
	 */
	@GetMapping("/{id}")
	public AccountVO getAccountById(@PathVariable("id") String id) {
		return orderService.getAccountById(id);
	}

}
